﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WMSSoft.Lib.Basic;
using WMSSoft.Lib.WinKStart.Abstract;

namespace WMSSoft.Lib.WinKStart.ViewModel
{
    public class CAddContextMenuViewModel : CContextMenuViewModel
    {
        public CAddContextMenuViewModel()
        {
            base.ViewName = LanguageStrings.GetText("Add Context-Menu Item");
            //New MenuItem
            ContextMenuItemKey = "";
        }

        protected override void ExecuteAddRegion()
        {
            base.ExecuteAddRegion();
        }

        protected override void ExecuteApplyData()
        {
            base.ExecuteApplyData();
            try
            {
                if (cMenuConfigReader.ConfigLoaded == true)
                {
                    if (cMenuConfigReader.ContextMenu.ContainsKey(ViewData.Name) == false)
                        cMenuConfigReader.ContextMenu.Add(ViewData.Name, ViewData);
                }
            }
            catch (Exception Ex)
            {
                CMessagelogging.AppendMessage("Can't Add Context-Menu-Item!", Ex, EMessageTypes.Error);
            }
        }

        protected override void ExecuteDeleteRegion()
        {
            base.ExecuteDeleteRegion();
        }

        protected override void ExecuteDiscardData()
        {
            base.ExecuteDiscardData();
        }
    }
}
